<template>
	<view class="page_box">
		<view class="padding-sm head-box bg-blue">
			<view class="x-bc top-state">
				<!-- <view class="x-bc xiaox round padding-xs">
					<view class="x-f">
						<text class="cuIcon-noticefill margin-right-xs"></text>
						<view class="more-t">消费者权益保护</view>
					</view>
					<text class="cuIcon-right"></text>
				</view>
				<text class="cuIcon-settingsfill"></text> -->
			</view>
			<view class="cu-list menu-avatar">
				<view class="cu-item">
					<view class="cu-avatar round lg">
						<image src="../../static/img/man-head.png"></image>
					</view>
					<view class="content">
						<view class="text-xl">
							{{info.name}}
						</view>
						<view class="text-xl">{{info.phone}}</view>
					</view>
					<view class="action">
						<text class="cuIcon-right"></text>
					</view>
				</view>
			</view>

		</view>

		<view class="content_box">
			<view class="cu-list menu sm-border card-menu margin-top">
				<view class="cu-item arrow">
					<view class="content">
						<image src="../../static/img/m_icon1.png" class="png" mode="aspectFit"></image>
						<text class="title">我的预约</text>
					</view>
				</view>
				<view class="cu-item arrow" @tap="jump('/pages/user/count/index')">
					<view class="content">
						<image src="../../static/img/m_icon2.png" class="png" mode="aspectFit"></image>
						<text class="title">练车记数</text>
					</view>
				</view>
				<view class="cu-item arrow" @tap="jump('/pages/public/forgot')">
					<view class="content">
						<image src="../../static/img/m_icon3.png" class="png" mode="aspectFit"></image>
						<text class="title">修改密码</text>
					</view>
				</view>
				<view class="cu-item">
					<view class="content">
						<image src="../../static/img/m_icon4.png" class="png" mode="aspectFit"></image>
						<text class="title">版本V1.3.45</text>
					</view>
				</view>
			</view>
			<view class="margin-tb padding">
				<view class="cu-btn block lg bg-white radius" @tap="logout">退出登录</view>
			</view>
		</view>

		<!-- 底部导航占位 -->
		<view class="cu-tabbar-height"></view>
		<!-- 底部导航 -->
		<yk-tabbar :pageCur="2"></yk-tabbar>

	</view>

</template>

<script>
	import {
		checkUserinfo
	} from '@/common/checkUserinfo.js'
	export default {
		data() {
			return {
				info: {}
			}
		},
		onLoad() {
			const token = wx.getStorageSync('token');
			if(!token)
			{
				uni.navigateTo({
					url: '/pages/public/login'
				})
			}
			this.info={
				name:wx.getStorageSync('name'),
				phone:wx.getStorageSync('phone')
			}
		},
		onShow() {
			// 获取用户信息
			// checkUserinfo()
		},
		methods: {
			jump(path){
				uni.navigateTo({
					url: path
				})
			},
			logout() {
				uni.removeStorageSync('userinfo');
				uni.navigateTo({
					url: '/pages/public/login'
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.head-box {
		.cuIcon-right,
		.cuIcon-settingsfill,
		.cuIcon-noticefill {
			font-size: 40rpx;
		}

		.xiaox {
			padding: 10rpx 30rpx;
			width: 55%;
			background: rgba(0, 0, 0, 0.15);

			.more-t {
				-webkit-line-clamp: 1;
				font-size: 30rpx;
			}
		}

		.cu-list.menu-avatar>.cu-item {
			background: transparent;
			padding: 0;
			height: 160rpx;
			margin-top: 30rpx;
		}

		.cu-list.menu-avatar>.cu-item>.cu-avatar {
			left: 0;
		}

		.cu-avatar.lg {
			width: 150rpx;
			height: 150rpx;
			border: 6rpx solid #ffffff;
			border-radius: 150rpx;
			overflow: hidden;

			image {
				width: 150rpx;
				height: 150rpx;
			}
		}

		.cu-list.menu-avatar>.cu-item .content {
			left: 170upx;
			width: calc(100% - 96upx - 60upx - 170upx - 20upx);
			line-height: 2.8em;
		}

		.cu-list.menu-avatar>.cu-item:after {
			height: 0;
			border: 0;
		}

		.cu-list.menu-avatar>.cu-item .content>uni-view:first-child {
			font-size: 36rpx;
		}
		.top-state{
			height: 50rpx;
			margin-top: 30rpx;
		}

	}

	.content_box {
		.title {
			line-height: 2.2em;
			display: inline-block;
			margin-left: 10rpx;
		}
	}
</style>
